<template>
  <div>
    <ul>
      <li v-for="item in myList" :key="item.id">
        <div>
          <img :src="item.url" alt="" />
        </div>
        <div>
          <p>{{ item.title }}</p>
        </div>
        <div>
          <p>{{ item.price }}</p>
        </div>
        <div><el-button @click="delBtn(item.id)">删除</el-button></div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    myList: {
      type: Array,
      default: [],
    },
  },
  methods: {
    delBtn(id) {
      this.$emit('delGood', id);
    },
  },
  mounted() {
    console.log(this.myList);
  },
};
</script>

<style lang="scss" scoped>
ul,
li {
  list-style: none;
}
ul li {
  float: left;
  width: 50%;
}
</style>
